
package cloud.xlh.config;



import cloud.xlh.interceptor.IpUrlLimitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2022/5/27 16:26
 * @ Description:
 */

@Configuration
public class MyWebMvcConfig implements WebMvcConfigurer {

    //暴力请求封ip

    @Autowired
    private IpUrlLimitInterceptor ipUrlLimitInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(ipUrlLimitInterceptor).addPathPatterns("/**");
    }
}


